home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1998 July
/
EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso
/
recent
/
iib122.lha
/
IIB
/
Threads
/
Additional
/
IARexx.lha
/
SpiralBall.irx
< prev
next >
Wrap
Text File
|
1997-03-19
|
3KB
|
114 lines
/*
Imagine5.0 Arexx Spiral Ball Creator
1996 Ernie - Freely distributable
(from an original script of Rob Darke)
*/
SYGNAL ON desist
ADDRESS 'Imagine.1'
NL = '0A'x
IF ~EXISTS('LIBS:rexxreqtools.library') THEN DO
NOTIFY 'Please install the rexxreqtools.library into your LIBS: directory'
NOTIFY 'It is available from /pub/aminet/util/rexx/RexxReqTools.lha'
exit
END
CALL ADDLIB('rexxreqtools.library',0,-30,0)
IF ~EXISTS('LIBS:rexxmathlib.library') THEN DO
CALL rtezrequest('Please install the rexxmathlib.library into your LIBS: directory' || NL || NL ||,
'The library is available from pub/aminet/util/rexx/RexxMathLib1.3.lha','Great, thanks!','Go get RexxMathLib.library','rt_reqpos = reqpos_centerscr')
exit
END
CALL ADDLIB('rexxmathlib.library',0,-30,0)
DISPLAYREXXPTR ON
radius = rtgetlong(25,'Enter spiral radius','Spiral Radius',,'rt_reqpos = reqpos_centerscr')
if ~rtresult then CALL desist
distance = rtgetlong(100,'Enter spiral length','Spiral Length',,'rt_reqpos = reqpos_centerscr')
if ~rtresult then CALL desist
angle = rtgetlong(720,'Enter total rotation angle','Spiral Rotation',,'rt_reqpos = reqpos_centerscr')
if ~rtresult then CALL desist
balls = 0
do while (balls = 0)
balls = rtgetlong(20,'Enter number of Balls','Total Balls',,'rt_reqpos = reqpos_centerscr')
end
if ~rtresult then CALL desist
ra = rtgetlong(32,'Enter radius of Balls','Balls Radius',,'rt_reqpos = reqpos_centerscr')
if ~rtresult then CALL desist
axesname = rtgetstring('SPIRAL.BALLS','Enter base name for Balls objects','Object name',,'rt_reqpos = reqpos_centerscr')
if ~rtresult then CALL desist
ret = rtezrequest('I am going to create a spiral set of 'balls' Balls' || NL ||,
' Radius = 'radius || NL ||,
' Length = 'distance || NL ||,
' Rotation = 'angle || NL ||,
' Ball Radius = 'ra || NL ||,
' Object base name = 'axesname, ' _Ok | _Abort','Notification','rt_reqpos = reqpos_centerscr')
if ~ret then CALL desist
/* So now lets begin ... won't this be fun ... */
singleangle = angle / (balls)
singlestep = distance / (balls-1)
pi = 3.141592654
po = (pi * 2)
DETAILEDITOR
ZOOM 1
/*CENTERAT 0 0 0*/
OBJECTMODE
MULTIPICKOFF
do i = 0 to (balls-1)
se = ((((singleangle*i) / 360)*po)-pi)
x = (radius * sin(se))
y = (radius * cos(se))
z = (i * singlestep)
ADDCSGSPHERE
DISPLAYSTOPREDRAW /* lets speed this a little */
PICK
TRANSFORM_POSITION x y z
/*TRANSFORM_ALIGNMENT 90 0 0*/
ATTRIB.OBJECTNAME = axesname'.'i
SETATTRIBUTES OBJECTNAME
if ra ~==32 then TRANSFORM_SIZE ra ra ra
end
ADDAXIS
PICK
TRANSFORMA_POSITION 0 0 0
TRANSFORMA_SIZE 0 (distance+100) 0
ATTRIB.OBJECTNAME = 'GROUP.'axesname
SETATTRIBUTES OBJECTNAME
MULTIPICKON
do i = 0 to (balls-1)
PICK axesname'.'i
end
MULTIPICKOFF
GROUPCASCADE
GROUPMODE
DISPLAYREXXPTR OFF
IMAGINETOFRONT
BEEP
CALL rtezrequest('Job done. Your set of 'balls' spiral Balls awaits ...','Thanks Ernie!','Spiral Ball','rt_reqpos = reqpos_centerscr')
exit
desist: procedure
DISPLAYREXXPTR OFF
exit
end